package calculator.entities;

import java.util.Collection;
import java.util.List;
import java.util.Vector;


/**
 * Klasa pozwalajca na trzymanie bardzo duzych liczb
 * @author Mirek
 */
public class SuperBigNumber extends MathEntity implements IMathEntity{
    private List<Integer> _digits;

    public SuperBigNumber(int number)
    {
        this._digits = new Vector<Integer>(10);
        while(number > 0)
        {
            this._digits.add(number%10);
            number /= 10;
        }
    }
    public SuperBigNumber(Collection<Integer> digits)
    {
        this._digits = new Vector<Integer>(digits.size());
        for(Integer digit: digits)
            this._digits.add(digit);
    }

    public IMathEntity add(IMathEntity a) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public IMathEntity substract(IMathEntity a) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public IMathEntity divide(IMathEntity a) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public IMathEntity multiply(IMathEntity a) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public IntegerNumber parseIntegerNumber() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public MyVector parseMyVector() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public SuperBigNumber parseSuperBigNumber() {
        return this;
    }

    public Collection<Integer> getValue()
    {
        return this._digits;
    }
    @Override
    public boolean equals(Object obj) {
        if(obj instanceof SuperBigNumber)
            return this._digits.equals(((SuperBigNumber)obj).getValue());
        return super.equals(obj);
    }

    
}
